@extends('layouts.default') @section('main')
<link rel="stylesheet" href="/css/uniform.css" />
<link rel="stylesheet" href="/css/select2.css" />
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
				class="icon-home"></i> 首页</a> <a href="#" class="current">活动报名管理</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
                <form action="{{url('activityapply/search')}}" method="post">
                    <table>
                        <tr>
                            <th>
                                <label >活动名称 :</label>
                            </th>
                            <th>
                                <div class="controls">
                                    <input type="text" class="span11" name="activity_name"  placeholder="活动名称" />
                                </div>
                            </th>
                            <th>
                                <label >报名人姓名 :</label>
                            </th>
                            <th>
                                <div class="controls">
                                    <input type="text" class="span11" name="name"  placeholder="报名人姓名" />
                                </div>
                            </th>
                            <th>
                                <label >报名人手机号 :</label>
                            </th>
                            <th>
                                <div class="controls">
                                    <input type="text" class="span11" name="tel"  placeholder="用户手机号" />
                                </div>
                            </th>
                            <th>
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                <div class="controls">
                                    <button type="submit" class="btn btn-info">查询</button>
                                </div>
                            </th>
                        </tr>
                    </table>
                </form>
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"><i class="icon-th"></i></span>
						<h5>活动报名管理</h5>
					</div>
					<div class="widget-content nopadding">
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>活动名称</th>
									<th>活动类型</th>
									<th>姓名</th>
									<th>手机号码</th>
									<th>活动地点</th>
									<th>签到码</th>
									<th>创建时间</th>
									<th>更新时间</th>
									<th>报名详情</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								@foreach($datas as $key => $data)
								<tr class="gradeX">
									<td title="{{$data->subject}}">{{cut_str($data->subject,10)}}</td>
									<td>{{$data->type_name}}</td>
									<td>{{$data->name}}</td>
									<td>{{$data->tel}}</td>
									<td>{{$data->maker_name}}</td>
									<td>{{$data->sign_code}}</td>
									<td>{{date('Y-m-d H:i:s',$data->created_at)}}</td>
									<td>{{date('Y-m-d H:i:s',$data->updated_at)}}</td>
									<td><a href="{{action('ActivityApplyController@getDetail',['aid'=>$data->id])}}">点击查看</a></td>
                                    <td class="center">
                                        @if(in_array('edit',$actions)) <a data-original-title="编辑" class="tip" href="{{url('activityapply/edit?id='.$data->id)}}"><i class="icon-pencil"></i></a> @endif
                                        {{--@if(in_array('delete',$actions)) <a data-original-title="删除" data-toggle="modal" class="tip activity_delete" activity_id="{{$activity->id}}" href="#myAlert"><i class="icon-remove"></i></a> @endif--}}
                                    </td>
                                </tr>
								@endforeach
							</tbody>
						</table>
					</div>
				</div><?php echo $datas->render();?>
      </div>
		</div>
	</div>
</div>
<div>
	<div id="myAlert" class="modal hide">
		<div class="modal-header">
			<button data-dismiss="modal" class="close" type="button">×</button>
			<h3>提示</h3>
		</div>
		<div class="modal-body">
			<p>确认删除这条数据吗？</p>
		</div>
		<div class="modal-footer">
			<a data-dismiss="modal" class="btn btn-primary" href="javascript:void(0);">确定</a>
			<a data-dismiss="modal" class="btn" href="javascript:void(0);">取消</a>
		</div>
	</div>
	<form action="{{url('activityprojectvideo/delete')}}" method="post"
		id="activityprojectvideoForm">
		<input type="hidden" name="vid" value="0">
	</form>
</div>
<script src="/js/matrix.tables.js"></script>
<script src="/js/common.js"></script>
<script>
$(".activity_project_video_delete").click(function(){
	var activity_project_video_id = $(this).attr("activity_project_video_id");
	$("input[name='vid']").val(activity_project_video_id);
});
$(".btn-primary").click(function(){
	var activity_project_video_id = $("input[name='vid']").val();
	if(activity_project_video_id == 0){
		alert('参数异常');
		return;
	}
	ajaxRequest($('#activityprojectvideoForm').serializeArray(),$('#activityprojectvideoForm').attr('action'),function(data){
		if(data.status){
			window.location.href = data.forwardUrl;
		}else{
			alert(data.message);
		}
	});
});
</script>
@stop
